1. Field of the Invention
The present invention relates to an apparatus and method for encoding data and generating a data stream. More particularly, the present invention relates to an apparatus and method of generating a data stream of the DVD standard or MPEG standard from video data and audio data and a recording/replaying apparatus for the same.
2. Description of the Related Art
A conventional MPEG encoder has a typical stream buffer with substantially the same capacity as an MPEG decoder. The MPEG encoder multiplexes video/audio elementary streams (ES) generated in real time using the stream buffer. A packaging order is determined one by one based on data quantities of video elementary stream (ES) and audio elementary stream (ES) in the stream buffer every time each of packs is outputted.
As shown in Japanese Laid Open Patent Applications (JP-P2000-268537A and JP-P2000-285648A), a video file is comprised of a plurality of program chains, and each program chain is comprised of a plurality of programs. Each program is comprised of a plurality of cells, and each cell is comprised of a plurality of video object units (hereinafter, to be referred to as “VOBU”). Each VOBU is comprised of a plurality of kinds of packs. As these packs, there are a navigation pack, a video pack, an audio pack, a sub picture pack and so on. The pack is comprised of one or more packets and a pack header, and is the minimum unit for a data transfer process. On the other hand, the minimum unit for a logical process is a cell.
In the conventional DVD apparatus, a small stream buffer with the capacity equal to or less than 1 VOBU is used for each of the video elementary stream (ES) and the audio elementary stream (ES), as shown in FIG. 1. The video elementary stream (ES) and the audio elementary stream (ES) are sequentially read out from the stream buffer. After that, a simulation is carried out to check whether a virtual buffer equivalent to the buffer of a decoder overflows or underflows, and the read out video/audio elementary streams (ES) are packaged as packs. The data stream generated in this way is outputted from the data stream generating apparatus. After that, when the data streams of the following VOBUs are generated, information in the navigation pack NV_PCK of the data stream outputted previously is updated based on them outside and then is written in a disk.
The virtual buffer simulation carried out at this time is shown in FIGS. 2 and 3. FIG. 2 shows the simulation to the video data and FIG. 3 shows the simulation to the audio data.
In FIG. 3, the horizontal axis is a system clock reference (SCR) showing a read start time on a replay time axis. The vertical axis is a storage quantity of the audio data in the virtual buffer. In FIG. 3, audio packs A_PCK are transferred and the storage quantity approaches the maximum storage capacity of the virtual buffer. After that, when the audio data is not yet consumed, SCR is carried forward. After that, the audio data is consumed and an empty space increases. At this time, the empty space increases step by step because the audio data of an approximately constant data quantity is consumed and is replayed.
On the other hand, in FIG. 2, the horizontal axis is the system clock reference (SCR). The vertical axis shows the storage quantity of the video stream code in the virtual buffer. As video packs V_PCK are transferred, the storage quantity of the buffer increases step by step. When the video packs V_PCK are not yet consumed even if they are transferred to the maximum storage quantity of the virtual buffer, the virtual buffer overflows, if the video pack V_PCK is further transferred. Therefore, when the video packs V_PCK are stored to the maximum storage quantity, SCR is carried forward until an empty space is secured for the next video pack V_PCK. When the storage capacity reduces rapidly, the replay of a picture is carried out. When the replay of the picture is carried out and the necessary empty space is secured, the next video packs V_PCK corresponding to the next picture are transferred.
The navigation pack NV_PCK is a pack which should be put at the head of VOBU or each GOP (Group of Picture). Various data of VOBU must be written in the navigation pack NV_PCK. Therefore, dummy values are set instead of the data, because the data cannot be known when the navigation pack NV_PCK is outputted, and then the navigation pack NV_PCK with the dummy values is outputted. These dummy values are defined by the DVD standard, the MPEG standard and so on. After the navigation pack NV_PCK is outputted, the dummy values must be rewritten outside to correct values.
Data such as video data in VOBU (GOP) which is generated from now, an address of VOBU (GOP) which is generated from now, replay start/end data of VOBU, and VOB (video object) must be written in the navigation pack NV_PCK. To update these data, it is necessary to know each address of VOBU in the future. Therefore, dummy values are set for these data, and the navigation pack NV_PCK is outputted. In this way, the navigation pack NV_PCK is multiplexed into the stream, using the stream buffer.
Therefore, in such a conventional encoder, it is necessary to update the navigation pack NV_PCK outside. In this way, there is a problem that the data stream cannot be completed simultaneously with generation of the data stream. Moreover, there is another problem that an external circuit structure and the process become complicated to make the data stream complete, resulting in increase of cost.
In conjunction with the above description, a digital video recording system is disclosed in Japanese Laid Open Patent Application (JP-P2000-268537A). In this reference, an information recording medium stores a data object which is comprised of at least one data object unit as a predetermined data unit; data object control information; and an access unit data which is contained in the control information and is used to access an access unit as a part of the content of the data object. The recording medium further stores a bit stream which is comprised of a sequence of a plurality of packets and includes the content of the data object and the control information.
Also, a data processing apparatus is disclosed in Japanese Laid Open Patent Application (JP-A-Heisei 11-288562). In this reference, the data processing apparatus multiplexes two or more bit streams into a multiplexed stream adaptive for first standard. A pack section divides each of the bit streams into packs as processing units. A recording section extracts pack information necessary for replay of each pack from each pack. An information pack generating section sets a dummy data in a data portion of an information pack to generate the information pack which has information necessary for replay control of replay units of a second standard stream as a multiplexed stream adaptive for a second standard. A multiplexing section generates the first standard stream adaptive for the first standard by multiplexing element packs generated by the pack section and the information pack generated by the information pack generating section. A converting section converts the first standard stream into the second standard stream by substituting the pack information corresponding to the information pack for the dummy data set in the data portion.
Also, an information recording medium is disclosed in Japanese Laid Open Patent Application (JP-P2000-285648A). The information recording medium has audio object information (AOB) and management information of audio information (AMG). The audio object information includes audio only title (AOTT) containing only audio information, and audio title (ATT) containing the audio only title and AV title (AVT) of audio information with video information. The management information includes navigation information (ATT_SPRT) used for the replay of the audio title (ATT), and navigation information (AOTT_SPRT) used for the replay of the audio only tile (AOTT).
Also, in a product letter, there are shown an example of application of an MPEG encoder LSI, and the functions of the LSI. However, any technical matters of the present invention are not shown.